--- Issue #218
module tests.qc.PierresPrime where

import Test.QuickCheck

prime' = f firstPrime
    where
        f n x = if (n < x)
            then if (mod x n == 0)
                then false
                else f (succ n) x
            else true
        firstPrime = 2

prime :: (Enum a, Integral a) => a -> Bool
prime = f firstPrime
    where
        f n x = if (n < x)
            then if (mod x n == 0)
                then false
                else f (succ n) x
            else true
        firstPrime = 2

pierres_property = once (not (prime' 9) && not (prime 9))

main :: IO ()
main = do
    println $ prime' 9
    println $ prime 9